package com.mx.pcs.lawyersfirm.servlets;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class ExampleServlet
 */
public class ExampleServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

    /**
     * Default constructor. 
     */
    public ExampleServlet() {
        // TODO Auto-generated constructor stub
    }
    
    public void process(HttpServletRequest request, HttpServletResponse response) {
    	String frstLstName = "equis";
    	String name = "ye";
//    	if(request.getAttribute("nombre") != null) {
//    		name = request.getAttribute("nombre").toString();
//    	}
//    	if(request.getAttribute("nombre") != null) {
//    		frstLstName = request.getAttribute("apellidoP").toString();
//    	}    	
    	
    	try {
    		System.out.println("servleeet");
			PrintWriter out = response.getWriter();
			out.println("name:" + name);
			out.println("frstLstName:" + frstLstName);
//			response.sendRedirect("/pages/jsp/Form.jsp");
			
			
			
		} catch (IOException e) {
			e.printStackTrace();
		}
    	
    	
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		process(request, response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		process(request, response);
	}

}
